<?php
declare (strict_types = 1);

namespace app\controller;

use app\BaseController;
use think\Request;
use think\Response;

class Api extends BaseController
{

    /**
     * 显示资源列表
     *
     * @return Response
     */
    public function index(): Response
    {
        return json([ 'code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 显示创建资源表单页.
     *
     * @return Response
     */
    public function create(): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 保存新建的资源
     *
     * @param Request $request
     *
     * @return Response
     */
    public function save(Request $request): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 显示指定的资源
     *
     * @param int $id
     *
     * @return Response
     */
    public function read(int $id): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 显示编辑资源表单页.
     *
     * @param int $id
     *
     * @return Response
     */
    public function edit(int $id): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 保存更新的资源
     *
     * @param Request $request
     * @param int     $id
     *
     * @return Response
     */
    public function update(Request $request, int $id): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }

    /**
     * 删除指定资源
     *
     * @param int $id
     *
     * @return Response
     */
    public function delete(int $id): Response
    {
        return json(['code' => 200, 'msg' => 'success', 'data' => []]);
    }
}
